﻿using Coldairarrow.Entity.PB;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_ProcecureSubPriceBusiness
    {
        /// <summary>
        /// 查询工序单价
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<ProcecureSubPriceDTO>> GetDataListAsync(PageInput<SubPriceConditionDTO> input);
        Task<PB_ProcecureSubPrice> GetTheDataAsync(string id);
        Task AddDataAsync(PB_ProcecureSubPrice data);
        Task UpdateDataAsync(PB_ProcecureSubPrice data);
        Task DeleteDataAsync(List<string> ids);

        /// <summary>
        /// 添加时间段的工序价格
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task InsertSubPriceAsync(SubPriceDTO data);
        IQueryable<T> GetQueryable<T>() where T : class, new();
        Task AddDataExlAsync(List<PB_MaterialPrice> list);


    }

    /// <summary>
    /// 添加时间段的工序价格
    /// </summary>
    public class SubPriceDTO
    {
        /// <summary>
        /// 开始日期
        /// </summary>
        public string StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public string EndDate { get; set; }

        /// <summary>
        /// 工序Id
        /// </summary>
        public string SubId { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        public double? Price { get; set; }

        /// <summary>
        /// 价格类型
        /// </summary>
        public int Type{ get; set; }
        /// <summary>
        /// 上限
        /// </summary>
        public double? Upperlimit { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public double? Lowerlimit { get; set; }

    }

    public class ProcecureSubPriceDTO : PB_ProcecureSubPrice
    {
        /// <summary>
        /// 工序名称
        /// </summary>
        public string SubName { get; set; }

    }

    public class SubPriceConditionDTO
    {
        public string Condition { get; set; }
        public string Keyword { get; set; }

        public string SubId { get; set; }

    }

}